/**
 * 
 */
package br.embedded.socialapp.business;

import org.opensocial.Client;
import org.opensocial.auth.AuthScheme;
import org.opensocial.auth.OAuth2LeggedScheme;
import org.opensocial.providers.MySpaceProvider;
import org.opensocial.providers.Provider;

/**
 * @author Daniel
 *
 */
public class MySpaceClientFactory 
{
	private static final String CONSUMER_KEY = "http://www.myspace.com/530434486";
	private static final String CONSUMER_SECRET = "ff7f750ed34045b3b67dcbcbd8f98514e8f2a2e479514989becc87e6625f4202";
	//private static final String CONSUMER_KEY = "http://www.myspace.com/495314457";
	//private static final String CONSUMER_SECRET = "69a94ff0644e43db8f127a3b595cd8a618e969d8d9b7416e85303315bafc6bae";
	
	private static Provider provider;
	private static AuthScheme authScheme;
	private static MySpaceClientFactory singleton;
	private static Client client;
	
	private MySpaceClientFactory()
	{
		provider = new MySpaceProvider();
		authScheme = new OAuth2LeggedScheme(CONSUMER_KEY, CONSUMER_SECRET);
		client = new Client(provider, authScheme);
	}
	
	public static MySpaceClientFactory getInstance()
	{
		if (singleton == null)
			singleton = new MySpaceClientFactory();
		return singleton;
	}
	
	public Client getClient()
	{
		return client;
	}
}
